/**
 * @name dfg-edge-gen
 * @id python/dfg-edge-gen
 */

import python
import util


from File f,EssaVariable v,ControlFlowNode node
where
f=node.getScope().getEnclosingModule().getFile()
and
node=v.getAUse()
and
isSource(f)
select v,node

// from File f,EssaNodeDefinition def,ControlFlowNode node,EssaVariable var,string filepath,string node_type,string node_value,string node_location
// where
// f=node.getScope().getEnclosingModule().getFile()
// and
// var=def.getVariable()
// and
// node=def.getDefiningNode()
// and
// filepath=f.getAbsolutePath()
// and
// prepare_cfg_node_id(node, node_type, node_value, node_location)
// and
// isSource(f)
// select var,node,filepath,node_type,node_value,node_location


// from File f,ControlFlowNode parent,ControlFlowNode child,BasicBlock basicBlock,string filepath,string location
// where
// parent.getScope().getEnclosingModule().getFile()=f
// and
// (child=parent.getASuccessor() or child.isEntryNode())
// and
// location=getLocText(child.getLocation())
// and
// filepath=f.getAbsolutePath()
// and
// isSource(f)
// and
// basicBlock.contains(child)
// select parent,child,basicBlock,filepath,location